//
//  TestProblem220.swift
//  LeetCodeTests
//
//  Created by 武侠 on 2023/6/28.
//  Copyright © 2023 zhulongiMac02. All rights reserved.
//

import XCTest
@testable import LeetCode

final class TestProblem220: XCTestCase {

    var problem = Problem220()
    
    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }
    
    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }
    
    // MARK: - 排序
    func testProblem220_Case1() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicate([1,2,3,1], 3, 0), true)
    }
    
    func testProblem220_Case2() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicate([1,5,9,1,5,9], 2, 3), false)
    }
    
    func testProblem220_Case3() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicate([8,7,15,1,6,1,9,15], 1, 3), true)
    }
    
    
    func testProblem220_2_Case1() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicateTong([1,2,3,1], 3, 0), true)
    }
    
    func testProblem220_2_Case2() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicateTong([1,5,9,1,5,9], 2, 3), false)
    }
    
    func testProblem220_2_Case3() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicateTong([8,7,15,1,6,1,9,15], 1, 3), true)
    }
    
    func testProblem220_2_Case4() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicateTong([-3,3], 2, 4), false)
    }
    
    func testProblem220_2_Case5() throws {
        XCTAssertEqual(problem.containsNearbyAlmostDuplicateTong([-3,3,-6], 2, 3), true)
    }
    
}
